package com.unytech.project.entity.security;

import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Index;

import com.unytech.project.entity.BaseEntity;

/**
 * 系统错误记录类
 * @author DolphinBoy
 *
 */
@Entity
@Table( name="T_ERRORRECORD" )
@GenericGenerator(name="uuidpk",strategy="uuid")
public class ErrorRecord extends BaseEntity {
	@Id @GeneratedValue(generator="uuidpk")
	@Column(length=32)
	@Index(name="errorid_index")
	private String errorid;
	
	@Column(length=60)
	private String errorclass;
	
	@Column(length=100)
	private String errordescribe;
	
	@Lob
	@Basic(fetch=FetchType.LAZY)
//	@Column(columnDefinition="CLOB")
	private String errorcontext;
	
	@Column(length=100)
	private String errorfile;
	
	private Integer submitor = 0;

	@OneToOne(cascade=CascadeType.PERSIST, optional=false)
	@JoinColumn(name="operaterecord_id")
	private OperateRecord operaterecord;
	
	
	public String getErrorid() {
		return errorid;
	}

	public void setErrorid(String errorid) {
		this.errorid = errorid;
	}

	public String getErrorclass() {
		return errorclass;
	}

	public void setErrorclass(String errorclass) {
		this.errorclass = errorclass;
	}

	public String getErrorcontext() {
		return errorcontext;
	}

	public void setErrorcontext(String errorcontext) {
		this.errorcontext = errorcontext;
	}

	public String getErrorfile() {
		return errorfile;
	}

	public void setErrorfile(String errorfile) {
		this.errorfile = errorfile;
	}

	public Integer getSubmitor() {
		return submitor;
	}

	public void setSubmitor(Integer submitor) {
		this.submitor = submitor;
	}

	public OperateRecord getOperaterecord() {
		return operaterecord;
	}

	public void setOperaterecord(OperateRecord operaterecord) {
		this.operaterecord = operaterecord;
	}

	public String getErrordescribe() {
		return errordescribe;
	}

	public void setErrordescribe(String errordescribe) {
		this.errordescribe = errordescribe;
	}

}
